package density.model;


import density.utils.KPPosConvert;

/**
 * Created by yuana on 2015/9/21.
 * Modified by jiangyangbo on 2017/9/21.
 * Modified by liuyu on 2020/05/09.
 */
public class DataPoint {
    /**
     * Created by liuyu on 2020/05/09
     * 业务关联编号
     */
    private String identify;
    /**
     * 坐标x
     */
    private double x;
    /**
     * 坐标y
     */
    private double y;
    /**
     * 是否已经被遍历
     */
    private boolean isVisited;
    /**
     * 是否核心点
     */
    private boolean isCore;
    /**
     * 是否噪音点
     */
    private boolean isNoise;

    public String getIdentify() {
        return identify;
    }

    public void setIdentify(String identify) {
        this.identify = identify;
    }

    public DataPoint(double x, double y) {
        KPPosConvert convert = new KPPosConvert();
        double[] d = convert.transform(x, y);
        this.x = d[1];
        this.y = d[0];
        
        isVisited = false;
        isCore = false;
        isNoise=false;
    }

    /**
     * 包含业务标识的构造函数
     * Created by liuyu on 2020/05/09      
     * @param identify
     * @param x
     * @param y
     */
    public DataPoint(String identify, double x, double y) {
        KPPosConvert convert = new KPPosConvert();
        /*double[] d = convert.transform(x, y);
        this.x = d[1];
        this.y = d[0];*/
        this.x = x;
        this.y = y;

        this.identify = identify; 
        isVisited = false;
        isCore = false;
        isNoise=false;
    }

    public DataPoint(double x, double y, boolean isVisited, boolean isCore) {
        KPPosConvert convert = new KPPosConvert();
        double[] d = convert.transform(x, y);
        this.x = d[1];
        this.y = d[0];
        this.isVisited = isVisited;
        this.isCore = isCore;
    }

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }

    public boolean isVisited() {
        return isVisited;
    }

    public void setIsVisited(boolean isVisited) {
        this.isVisited = isVisited;
    }

    public boolean isCore() {
        return isCore;
    }

    public void setIsCore(boolean isCore) {
        this.isCore = isCore;
    }

    public boolean isNoise() {
        return isNoise;
    }

    public void setIsNoise(boolean isNoise) {
        this.isNoise = isNoise;
    }

    public String toString() {
        return String.format("[%s, %s]", this.x, this.y);
    }
     
}
